home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / BEERSRC.ZIP / DESCRIPT.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-09  |  1.2 KB  |  63 lines

  1.  
  2. #include <stdio.h>
  3. #include <alloc.h>
  4. #include <io.h>
  5. #include <sys\stat.h>
  6. #include <fcntl.h>
  7. #include <string.h>
  8. #include <process.h>
  9.  
  10.  
  11.  
  12.  
  13. void main(void)
  14. {
  15.    char   file[80];
  16.    int    filvar;
  17.    int    level;
  18.    char   text[40];
  19.    int    bigboss;
  20.    int    score;
  21.    int      money;
  22.    int    flags;
  23.  
  24.    printf("\n\nBaller Game Description Creator [c] by ALPHA-HELIX.\n\n");
  25.    printf("Descript File [.DSC]: ");
  26.    fflush(stdin);
  27.    scanf("%s", file);
  28.    strcat(file, ".DSC");
  29.  
  30.    filvar = open(file, O_CREAT | O_TRUNC | O_WRONLY | O_BINARY, S_IWRITE);
  31.  
  32.    printf("\nLevel #     : ");
  33.    fflush(stdin);
  34.    scanf("%u", &level);
  35.    write(filvar, &level, 2);
  36.    printf("Text[40]    : ");
  37.    fflush(stdin);
  38.    gets(text);
  39.    write(filvar, text, 40);
  40.    printf("# of endlevel Big Bosses : ");
  41.    fflush(stdin);
  42.    scanf("%u", &bigboss);
  43.    write(filvar, &bigboss, 2);
  44.    printf("Bonus score : ");
  45.    fflush(stdin);
  46.    scanf("%u", &score);
  47.    write(filvar, &score, 2);
  48.    printf("Bonus money : ");
  49.    fflush(stdin);
  50.    scanf("%u", &money);
  51.    write(filvar, &money, 2);
  52.    printf("Flags [hex] : ");
  53.    fflush(stdin);
  54.    scanf("%x", &flags);
  55.    write(filvar, &flags, 2);
  56.  
  57.    close(filvar);
  58.  
  59.  
  60. }
  61.  
  62.  
  63.